package com.naiterui.ehp.bs.cms.modules.base.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.naiterui.ehp.bs.cms.common.constants.DsName;
import com.naiterui.ehp.bs.cms.modules.base.vo.CityPageVO;

/**
 * @author 潘xin
 * @since 2021/9/13
 */
@DS(DsName.EHP)
public interface CmsCityBaseMapper {

    Page<CityPageVO> getPage(@Param("page") IPage<CityPageVO> page, @Param("ew") Wrapper<CityPageVO> entityWrapper);

    @Select("select * from cms_city where id =#{cityId}")
    CityPageVO getById(@Param("cityId") Long cityId);

    void saveOrUpdateCity(CityPageVO cityPageVO);

    @Update(" update cms_city set available=#{status}  where id = #{cityId}")
    void updateCityStatus(@Param("cityId") Long cityId, @Param("status") Integer status);

}
